<?php
/**
 * @file
 * @package mileage
 * @version $Id$
**/

if (!defined('XOOPS_ROOT_PATH')) {
	exit;
}

require_once XOOPS_ROOT_PATH . '/core/XCube_ActionForm.class.php';
require_once XOOPS_MODULE_PATH . '/legacy/class/Legacy_Validator.class.php';

/**
 * Mileage_Admin_MileDeleteForm
**/
class Mileage_Admin_MileDeleteForm extends XCube_ActionForm
{
	/**
	 * getTokenName
	 * 
	 * @param   void
	 * 
	 * @return  string
	**/
	public function getTokenName()
	{
		return "module.mileage.Admin_MileDeleteForm.TOKEN";
	}

	/**
	 * prepare
	 * 
	 * @param   void
	 * 
	 * @return  void
	**/
	public function prepare()
	{
		//
		// Set form properties
		//
		$this->mFormProperties['mile_id'] = new XCube_IntProperty('mile_id');

		//
		// Set field properties
		//
		$this->mFieldProperties['mile_id'] = new XCube_FieldProperty($this);
		$this->mFieldProperties['mile_id']->setDependsByArray(array('required'));
		$this->mFieldProperties['mile_id']->addMessage('required', _MD_MILEAGE_ERROR_REQUIRED, _MD_MILEAGE_LANG_MILE_ID);
	}

	/**
	 * load
	 * 
	 * @param   XoopsSimpleObject  &$obj
	 * 
	 * @return  void
	**/
	public function load(/*** XoopsSimpleObject ***/ &$obj)
	{
		$this->set('mile_id', $obj->get('mile_id'));
	}

	/**
	 * update
	 * 
	 * @param   XoopsSimpleObject  &$obj
	 * 
	 * @return  void
	**/
	public function update(/*** XoopsSimpleObject ***/ &$obj)
	{
		$obj->set('mile_id', $this->get('mile_id'));
	}
}
